-
-
Notifications
You must be signed in to change notification settings - Fork 371
Flush Logs on WillTerminate or WillResignActive App State
#6909
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WillTerminate or WillResignActive` App State
WillTerminate or WillResignActive` App StateWillTerminate or WillResignActive App State
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6909 +/- ##
=============================================
+ Coverage 85.057% 85.082% +0.024%
=============================================
Files 453 454 +1
Lines 27633 27686 +53
Branches 12139 12155 +16
=============================================
+ Hits 23504 23556 +52
+ Misses 4086 4084 -2
- Partials 43 46 +3
... and 10 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
|
The app state manager is only enabled for UIKit, but the notification-equivalents for terminate/active should also be available for macOS. Is this intended behaviour? |
Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| d38165b | 1211.41 ms | 1242.49 ms | 31.08 ms |
| 409a607 | 1229.57 ms | 1251.45 ms | 21.88 ms |
| 94a6b1a | 1213.39 ms | 1231.55 ms | 18.17 ms |
| 7f4bf81 | 1241.73 ms | 1270.66 ms | 28.93 ms |
| 4d264fa | 1223.48 ms | 1246.91 ms | 23.44 ms |
| c2982e7 | 1223.92 ms | 1242.86 ms | 18.94 ms |
| d66f082 | 1227.08 ms | 1247.04 ms | 19.96 ms |
| e36128b | 1213.04 ms | 1248.60 ms | 35.56 ms |
| 5db87fa | 1218.88 ms | 1251.53 ms | 32.65 ms |
| 5c2d5d6 | 1225.39 ms | 1259.45 ms | 34.06 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| d38165b | 23.75 KiB | 855.37 KiB | 831.62 KiB |
| 409a607 | 23.74 KiB | 874.08 KiB | 850.33 KiB |
| 94a6b1a | 23.75 KiB | 902.48 KiB | 878.74 KiB |
| 7f4bf81 | 23.75 KiB | 919.70 KiB | 895.95 KiB |
| 4d264fa | 23.74 KiB | 874.07 KiB | 850.33 KiB |
| c2982e7 | 23.75 KiB | 911.62 KiB | 887.87 KiB |
| d66f082 | 23.75 KiB | 928.85 KiB | 905.10 KiB |
| e36128b | 23.75 KiB | 963.19 KiB | 939.44 KiB |
| 5db87fa | 23.75 KiB | 926.65 KiB | 902.90 KiB |
| 5c2d5d6 | 23.75 KiB | 969.28 KiB | 945.54 KiB |
Previous results on branch: feat/flush-logs-on-app-state-change
Startup times
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 58c01c4 | 1193.19 ms | 1242.47 ms | 49.28 ms |
| 5a96fbe | 1223.24 ms | 1239.82 ms | 16.57 ms |
| e1bf267 | 1215.20 ms | 1241.04 ms | 25.84 ms |
| 6b6ef93 | 1192.06 ms | 1212.08 ms | 20.02 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 58c01c4 | 24.14 KiB | 1.01 MiB | 1013.67 KiB |
| 5a96fbe | 24.14 KiB | 1.01 MiB | 1015.46 KiB |
| e1bf267 | 24.14 KiB | 1.01 MiB | 1015.57 KiB |
| 6b6ef93 | 24.14 KiB | 1.01 MiB | 1015.51 KiB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this. I found a few high-level issues we need to address before I give this a closer look.
# Conflicts: # Sentry.xcodeproj/project.pbxproj
Tests/SentryTests/Integrations/Log/SentryLogFlushIntegrationTests.swift
Outdated
Show resolved
Hide resolved
| - Expose attachment type on `SentryAttachment` for downstream SDKs (like sentry-godot) (#6521) | ||
| - Increase attachment max size to 100MB (#6537) | ||
| - Increase maximum attachment size to 200MB (#6726) | ||
| - Flush Logs on `WillTerminate` or `WillResignActive` App State (#6909) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 🚫 The changelog entry seems to be part of an already released section
## 9.0.0.
Consider moving the entry to the## Unreleasedsection, please.
| #elseif (os(macOS) || targetEnvironment(macCatalyst)) && !SENTRY_NO_UIKIT | ||
| import AppKit | ||
| private typealias CrossPlatformApplication = NSApplication | ||
| #endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Mac Catalyst incorrectly imports AppKit instead of UIKit
The conditional compilation directives incorrectly import AppKit for Mac Catalyst apps. Mac Catalyst uses UIKit and UIApplication, not AppKit and NSApplication. The targetEnvironment(macCatalyst) condition should be included in the first #if block with iOS/tvOS (line 3), not in the #elseif block with macOS (line 6). This causes the wrong framework to be imported and the wrong application type to be used for Mac Catalyst builds.
📜 Description
captureLogson batcher if app terminatescaptureLogson batcher if app resigns activeIntroduces listeners on the AppState and observes it in a conditional (UIKit) integration.
💡 Motivation and Context
Implements missing behaviour from batch processor spec.
Closes #6478
💚 How did you test it?
Added tests and tested manually.
📝 Checklist
You have to check all boxes before merging:
sendDefaultPIIis enabled.